package com.acme.bankapp.service.account;

import com.acme.bankapp.domain.bank.*;

/**
 * Class provides account factory functionality
 * @author alex
 */
public class AccountFactory {
	/**
	 * @param balance the balance
	 * @param overdraft the overdraft
	 * @return the account
	 */
	public static Account createAccount(double balance, double overdraft) {
		if (overdraft > 0) {
			return new CheckingAccount(balance, overdraft);
		} else {
			return new SavingAccount(balance);
		}
	}
}
